package jdkc;

import com.mysql.jdbc.Driver;
import util.JDBCUtils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/*
 *@Student 张策
 */
public class jdbc {
    public static void main(String[] args) throws Exception {
        //导入对应的数据库驱动jar包
        //注册驱动

        //获取数据库连接对象
        Connection conn = JDBCUtils.getConnection();
        //定义sql语句
        String sql="update acc set account=17 where id=1";
        //获取执行sql的对象 Statement
        Statement state = conn.createStatement();
        //执行sql
        int count = state.executeUpdate(sql);
        System.out.println(count);
        //释放资源
        state.close();
        conn.close();
    }
}
